package cn.edu.ujn.lab1.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.lab1.dao.IStudentDao;
import cn.edu.ujn.lab1.dao.IUserDao;
import cn.edu.ujn.lab1.model.Student;
import cn.edu.ujn.lab1.model.User;
@Service
public class StudentServiceImpl implements IStudentService{
	@Autowired
	private IUserDao userDao;
	@Autowired
	private IStudentDao studentDao;
	@Override
	public Student addStudent(Student stu,User user) {
		// TODO 自动生成的方法存根
		User addUser = this.userDao.addUser(user);
		stu.setUid(addUser.getUid());
		Student addStudent = this.studentDao.addStudent(stu);
		return addStudent;
	}

	@Override
	public List<Student> findAllStudent() {
		// TODO 自动生成的方法存根
		return this.studentDao.findAllStudent();
	}

}
